Skip to content

sync docs#67 spec fixes + restore toon tag (toon keys regressed to PascalCase in #3)#4

Merged
ysyneu merged 2 commits into
mainfrom
chore/sync-docs-67-spec-fixes
Jun 2, 2026
Merged

sync docs#67 spec fixes + restore toon tag (toon keys regressed to PascalCase in #3)#4
ysyneu merged 2 commits into
mainfrom
chore/sync-docs-67-spec-fixes

Conversation

@ysyneu
Copy link
Copy Markdown
Collaborator

@ysyneu ysyneu commented Jun 2, 2026

Two commits. Surfaced by the fduty CLI full-coverage agent eval while landing the spec fixes downstream.

Commit 1 — sync OpenAPI from flashduty-docs main (incl. docs#67) + regenerate

Fix SDK effect
AuditRecordIDRequest split off RuleIDRequest for /monit/rule/audit/detail ReadAuditDetail now takes *AuditRecordIDRequest (id = audit-record id, not rule id)
IncidentShort/IncidentRawItem.progress enum corrected to Triggered/Processing/Closed
InsightFilter.export_fields 29-value column-key enum
/incident/post-mortem/info clearer description

Commit 2 — fix(gen): restore the toon struct tag ⚠️ regression from #3

#3 dropped the toon:"..." tag from generated structs (emitting only json:"..."). But toon-go (internal/codec/structmeta.go) reads only the toon tag and falls back to the Go field name when absent — it does not read json. So since #3, --output-format toon renders PascalCase keys (AccountID, CreatedAt) instead of snake_case (account_id, created_at), while --json stays snake_case.

This breaks every toon consumer (CLI, MCP) and the agent pattern "read field name from a toon dump → --json | jq '.account_id'" → all-null. Evidence (same incident list --output-format toon):

Restored the tag + re-added the explaining comment so it is not dropped again. @author of #3 — flag me if you intended a different fix (e.g. teaching toon-go to read json); this is the minimal proven restore.

No release (untagged). go generate ./... + go build/go vet green.

Deferred (separate PRs)

  • omitempty request/response split (drop ,omitempty on response structs so false/0/[]/{} survive --json) — layers on the same emitStruct line; patch saved.
  • monit-webapi: split alertRuleAuditDetails' input off the shared types.IDInput so a future api-review regen keeps AuditRecordIDRequest (needs schema-naming verification).

ysyneu added 2 commits June 2, 2026 10:19
Picks up the 4 spec fixes merged in flashcatcloud/flashduty-docs#67, surfaced
by the fduty CLI full-coverage agent eval:

- AuditRecordIDRequest split off RuleIDRequest for /monit/rule/audit/detail —
  ReadAuditDetail now takes *AuditRecordIDRequest; its id is the audit-record id
  from /monit/rule/audits rows, not the rule id.
- IncidentShort/IncidentRawItem.progress enum corrected (Triggered/Processing/Closed).
- InsightFilter.export_fields 29-value column-key enum.
- /incident/post-mortem/info description clarified (fetch by post_mortem_id).

Pure sync + `go generate ./...` against the current generator; build green.
No release (untagged).
#3 dropped the `toon:"..."` tag from generated structs, emitting only
`json:"..."`. But toon-go (internal/codec/structmeta.go) reads ONLY the `toon`
tag and falls back to the Go field NAME when it is absent — it does NOT read
`json`. So `--output-format toon` started rendering PascalCase keys (AccountID,
CreatedAt) instead of snake_case (account_id, created_at), while `--json` and
the spec-derived help stayed snake_case. An agent that reads a field name off a
toon dump and pipes it into `--json | jq '.account_id'` hits all-null.

Restore the `toon` tag mirrored from `json` (snake_case), and re-add the
comment explaining why so it is not dropped again. Verified: toon keys are
snake_case again across generated list output.
@ysyneu ysyneu changed the title chore: sync OpenAPI from flashduty-docs + regenerate (docs#67) sync docs#67 spec fixes + restore toon tag (toon keys regressed to PascalCase in #3) Jun 2, 2026
@ysyneu ysyneu merged commit 4702172 into main Jun 2, 2026
4 checks passed
@ysyneu ysyneu deleted the chore/sync-docs-67-spec-fixes branch June 2, 2026 03:08
ysyneu added a commit that referenced this pull request Jun 2, 2026
The compiled `gen` executable (go build ./internal/cmd/gen at repo root) was
accidentally swept into #4 by git add -A. Remove the 4.3MB binary and ignore
the root-level /gen path (anchored so it doesn't match internal/cmd/gen/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant